import Vue from 'vue'
import Vuex from 'vuex'


Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    auth:{
      token:'',
      exp_at:'',
    },
    user:{
      email: "",
      from_user_id: 0,
      head_img: "",
      invite_code: "",
      itac: "",
      name: "",
      open_id: "",
      phone: "",
    },
    member:{
      card_no:'',
      exp_at:'',
      grade:'',
      order_no:'',
    },
    color:{
      bgcolor:'#fff',
      titlecolor:'#515C6F',
      subheadcolor:'#727C8E',
      themecolor:'#07A34F'
    },
    alert:{
      icon:'',
      text:'',
      show:false
    },
    progress:true
  },
  mutations: {
    setProgress(state, data){
      state.progress = data
    },
    setUser(state, data){
      state.user = data.user
    },
    setMember(state, data){
      state.member = data.member
    },
    setAuthtoken(state, data){
      state.auth = data.auth
    },
    setAlert(state, data){
      state.alert = data
    },
  },
  actions: {
    
  }
})
